$(document).ready(function() {

	//Index.jsp Dynamische Inhalte nachladen bei Klick auf entsprechenden Link. Davor wird die Div, die die Fehler anzeigt ausgeblendet.

	//AGB Inhalt nachladen
	$('#footermenu').on('click', '#agb_ajax', function() {
		document.getElementById('errorsection').style.display = 'none';
		$("#section").animate({
			opacity : "0",
			filter : "alpha(opacity=0)"
		}, 400, function() {
			$("#section").load("agb_ajax.jsp", function() {
				$("#section").animate({
					opacity : "1",
					filter : "alpha(opacity=100)"
				}, 400);
			});
		});
	})
	//Impressum Dyn-Inhalt Nachladen
	$('#footermenu').on('click', '#impressum_ajax', function() {
		document.getElementById('errorsection').style.display = 'none';
		$("#section").animate({
			opacity : "0",
			filter : "alpha(opacity=0)"
		}, 400, function() {
			$("#section").load("impressum_ajax.jsp", function() {
				$("#section").animate({
					opacity : "1",
					filter : "alpha(opacity=100)"
				}, 400);
			});
		});
	})

	$('#section').on('click', '#login_ajax', function() {
		document.getElementById('errorsection').style.display = 'none';
		$("#section").animate({
			opacity : "0",
			filter : "alpha(opacity=0)"
		}, 400, function() {
			$("#section").load("login_ajax.jsp", function() {
				$("#section").animate({
					opacity : "1",
					filter : "alpha(opacity=100)"
				}, 400);
			});
		});
	});
	//Registrieren Dyn-Inhalt Nachladen

	$('#section').on('click', '#register_ajax', function() {
		document.getElementById('errorsection').style.display = 'none';
		$("#section").animate({
			opacity : "0",
			filter : "alpha(opacity=0)"
		}, 400, function() {
			$("#section").load("register_ajax.jsp", function() {
				$("#section").animate({
					opacity : "1",
					filter : "alpha(opacity=100)"
				}, 400);
			});
		});
	})
	//PW-Vergessen Dyn-Inhalt Nachladen
	$('#section').on('click', '#forgot_ajax', function() {
		document.getElementById('errorsection').style.display = 'none';
		$("#section").animate({
			opacity : "0",
			filter : "alpha(opacity=0)"
		}, 400, function() {
			$("#section").load("forgot_ajax.jsp", function() {
				$("#section").animate({
					opacity : "1",
					filter : "alpha(opacity=100)"
				}, 400);
			});
		});
	});

	//Kontakt Dyn-Inhalt Nachladen
	$('#footermenu').on('click', '#kontakt_notloggedin_ajax', function() {
		document.getElementById('errorsection').style.display = 'none';
		$("#section").animate({
			opacity : "0",
			filter : "alpha(opacity=0)"
		}, 400, function() {
			$("#section").load("kontakt_notloggedin_ajax.jsp", function() {
				$("#section").animate({
					opacity : "1",
					filter : "alpha(opacity=100)"
				}, 400);
			});
		});
	});

	//FAQ Dyn-Inhalt Nachladen
	$('#footermenu').on('click', '#faq_ajax', function() {
		document.getElementById('errorsection').style.display = 'none';
		$("#section").animate({
			opacity : "0",
			filter : "alpha(opacity=0)"
		}, 400, function() {
			$("#section").load("faq_ajax.jsp", function() {
				$("#section").animate({
					opacity : "1",
					filter : "alpha(opacity=100)"
				}, 400);
			});
		});
	});

});